Field of the Invention
The present invention relates to an image forming apparatus and a resource management method.
Description of the Related Art
In order realize solutions, an increasing number of current multifunction peripherals (MFPs) have functions for executing applications apart from the functions incorporated in the MFPs, such as copying, scanning, and printing of documents. Many MFPs have an execution environment for Java (registered trademark) as an application execution environment, and can execute applications written in Java. Examples of an application execution environment include Canon's MEAP. In the case of a Java application on a PC, one Java process executes one application. On the other hand, there are many MFPs that use an OSGi framework or the like and execute a plurality of applications using one Java process due to limitations on the CPU or memory. The OSGi framework is an application platform for executing a plurality of applications on one Java VM. In the case where one of applications that are being executed on an MFP has a bug and a resource leak such as a memory leak, for example, occurs, there is a possibility that an error resulting from a resource shortage such as OutOfMemoryError will occur and all applications will stop. Also, since an error resulting from a resource shortage, such as OutOfMemoryError, for example, occurs when an application requests a resource and the resource to be allocated is not available, there are cases where such an error occurs while an application that is running normally is being executed.
Therefore, it is difficult to specify the application where the resource leak has occurred.
Incidentally, there are techniques for measuring resources for each thread, as described in Japanese Patent Laid-Open No. 2005-269439. However, it is not possible to measure use resources for each application in the case where one thread executes the codes of a plurality of applications, as shown in FIG. 13 in Japanese Patent Laid-Open No. 2005-269439.
Moreover, there are techniques for managing resources by modifying the application execution environment itself, as shown in Japanese Patent Laid-Open No. 2013-145503. However, there are difficulties in performing modification that adds resource management to the application execution environment in an MFP that has limited resources such as memory and CPU.